package com.xm.biz.impl;

import com.xm.biz.CartBiz;
import com.xm.dao.CartDao;
import com.xm.dao.impl.CartDaoImpl;
import com.xm.po.Cart;

import java.util.List;

/**
 * @author Administrator
 * @date 2020-08-21-9:40
 * @description 购物车数据操作接口业务逻辑接口实现类
 */
public class CartBizImpl implements CartBiz {
    CartDao cartDao=new CartDaoImpl();
    @Override
    public List<Cart> getAll() {
        return cartDao.getAll();
    }

    @Override
    public boolean deleteCart(Integer cartId) {
        return cartDao.deleteCart(cartId);
    }

    @Override
    public boolean updateCart(Cart cart) {
        return cartDao.update(cart);
    }

    @Override
    public Cart findInfo(Integer cartId) {
        return cartDao.findInfo(cartId);
    }

    @Override
    public boolean add(Cart cart) {
        return cartDao.add(cart);
    }

    @Override
    public List<Cart> getCartByIdChecked(Integer userId) {
        return cartDao.getCartByIdChecked(userId);
    }

    @Override
    public boolean isCheck(Integer goodsId, Integer userId, Integer isCheck) {
        return cartDao.isCheck(goodsId, userId, isCheck);
    }

    @Override
    public List<Cart> getAll(Integer userId) {
        return cartDao.getAll(userId);
    }

    @Override
    public Cart getCartById(Integer goodsId, Integer userId) {
        return cartDao.getCartById(goodsId, userId);
    }

    @Override
    public boolean delete(Integer goodsId, Integer userId) {
        return cartDao.delete(goodsId, userId);
    }
}
